package chapter8.inheritance;
class A {
	void stuff(){
		
	}
}
class B extends A{
	void newstuff(){
		
	}
	
	int B(String msg){
		return 1;
	}
}
class C extends A{}
public class ExamQuestion {

	public static void main(String[] argss){
		A a =new A();
		B b = new B();
		C c = new C();
		a=b;// no problem here subclass assigned to a super class variable
		//c=a;//reverse is not true
		b = (B) a;//runtime issue?no 
		//c =(C)b;//not related
		//b=(A)b; //cannot cast up
		b.stuff();
		b.B("a");
		System.out.println("test");
	}
}
